a machine, because it drops all data from the network into your machine. this is of course too secure. At this time, your machine will be equivalent to no network. if you ping localhost, you will find that the screen is always there, because ping cannot receive any response.4. Add RulesRun the following command:Iptables-a input-I! Ppp0-j ACCEPTThis rule indicates accepting all data from the network interface ppp0
drops all data from the network into your machine. This is of course too secure. At this time, your machine will be equivalent to no network. If you ping localhost, you will find that the screen is always there, because Ping cannot receive any response.
4. Add Rules
Run the following command:
Iptables-A input-I! Ppp0-J accept
This rule means accepting all data from the network interface ppp0.
Assume that y
careful when you are out of warranty! If you are using redhat or fedora, you have a simpler method.
Service iptables stop
3. start setting rules:
Next, set your rules.
Iptables-P INPUT DROP
This command will build a very "secure" firewall for you. it is hard to imagine which hacker can break such a machine, because it drops all data from the network into your machine. This is of course too secure. at this time, your machine will be equivalent to no network. If you pinglocalhost, you will find t
in many cases, be careful when you are out of warranty! If you are using redhat or fedora, you have a simpler method.
Service iptables stop
3. start setting rules:
Next, set your rules.
Iptables-P INPUT DROP
This command will build a very "secure" firewall for you. it is hard to imagine which hacker can break such a machine, because it drops all data from the network into your machine. This is of course too secure. at this time, your machine will be equivalent to no network. If you pinglocalho
Iptables-T nat-F
Iptables-T nat-x
Each of the preceding commands has its exact meaning. Before setting your iptables, we need to clear all previously set rules and call them initialization. Although it does not do anything in many cases, be careful when you are out of warranty! If you are using RedHat or fedora, you have a simpler method.
Service iptables stop
3. Start setting rules:
Next, set your rules.
Iptables-P input drop
This command will build a very "secure" firewall for you. It is hard
three network cards. You can also refer to other information to configure the network card.
Configure to find the corresponding model module, for example, eth2 is 8139 Nic
[Root @ kindgeorge root] # vi/etc/modules. conf
Alias parport_lowlevel parport_pc
Alias eth0 tulip
Alias eth1 3c59x
Alias eth2 8139too
Add new lines to eth2
2. Configure adsl
Method 1:
(1) run the adsl-setup program and you will be prompted to complete the configuration process step by step.
Create a dial-up profil
/icmp_echo_ignore_broadcastsEcho 0>/proc/sys/net/ipv4/conf/all/accept_source_routeEcho 0>/proc/sys/net/ipv4/conf/all/accept_redirectsEcho 1>/proc/sys/net/ipv4/icmp_ignore_bogus_error_responsesEcho 1>/proc/sys/net/ipv4/conf/all/log_martiansEcho 1>/proc/sys/net/ipv4/ip_forward/Sbin/iptables-F INPUT/Sbin/iptables-F FORWARD/Sbin/iptables-X/Sbin/iptables-Z# Allow forwarding through the internal interface/Sbin/iptables-a forward-m state -- state ESTABLISHED, RELATED-j ACCEPT# Do masquerading through
interface (-I, O)
source, Destination address (-s,-D)
Protocol type (-P)
Source, Destination Port (--sport 、--dport)
3.3.1 Match by Network interface
-I For example:
-I. eth0
Whether the match came in from the network interface eth0
-I. PPP0
Whether the match came in from the network interface ppp0
The network interface for-O matched data outflow
For example:
-O eth0
-O
, ifconfig displays information about ppp0 (note that no information about other physical NICS is provided here, you know, but it does not affect the effect in practice)?Shell Command example
[Root @ **** ~] # IfconfigPpp0 Link encap: Point-to-Point ProtocolInet addr: 121.34.103.105 P-t-P: 121.34.100.1 Mask: 255.255.255.255Up pointopoint running noarp multicast mtu: 1492 Metric: 1RX packets: 54809 errors: 0 dropped: 0 overruns: 0 frame: 0TX packets: 5
Command Example[root@**** ~]# Cat/etc/ppp/chap-secrets# Secrets for authentication using CHAP# Client Server Secret IP addresses####### Redhat-config-network would overwrite this part!!! (BEGIN) ################# Redhat-config-network would overwrite this part!!! (end) ############"ADSL Account" * "Password"
4. Plug all the cats into a different physical network card. Follow the 2,3 step to add the profile and password at once.
5. Test dialing Now (then test the different profiles once, equal
the Pseudo Terminal is the input from the master device of the Pseudo Terminal, and vice versa.Ii. pppoe Overview
The pppoe protocol is based on the PPP protocol. The PPP protocol is not implemented in the pppoe application. The PPP protocol is implemented by the pppd user space program, the pppoe program only implements Part Of The pppoe protocol code. When appropriate, the pppd program implements the PPP protocol.After connecting the pppoe user program to the pppoe server, he will establish a
"Apply" button to ok! the following figure 56
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7 this.alt= ' Click here to open new Window\nctrl+mouse Wheel to zoom in/out ';} ' Border=0>
The above figure shows that the broadband connection (PPP0) appears in the Network Connections window.
v. Activating network equipment
The broadband Connection (PPP0) is already present in the Network Con
the default rule can be processed.
Isn't it easy? for personal desktop applications, just the two statements just now can make your hosts connected to the internet secure enough. And you can access the internet at will, but the external connection cannot be initiated to your machine!
Of course, if your IE has a vulnerability, iptables is useless, and this is not the scope of iptables.
We can see that stateful firewalls are more "intelligent" than static firewalls. of course, rules are easier to
Interface (such as ppp0. (You Need To Know How sockets with 0x8863 and 0x8864 work, and how packets are transmitted between pppoe and PPP protocol stacks through the Pty device ).
[2] pppd: Works with pppoe to complete dial-up Internet access negotiation and maintenance.
[3]/dev/PPP: After a PPP device is created, packets in the PPP process are classified by the protocol stack and transmitted to the queue of this interface. Pppd reads packets in the
inexplicable errors, which could not be solved by Google Daxian. For example:
Connect: ppp0 Warning-secret file/etc/PPP/PAP-secrets has world and/or group accespppoe: Read (asyncreadfromppp): SWarning-secret file/etc/PPP/PAP-secrets has world and/or group accessRemote message: limit users errPAP authentication failedConnection terminated.Pppoe: Read (asyncreadfromppp): Session 11215: Input/Output Error
LCP: timeout sending config-RequestsConnection t
preroutingList all the rules and detailed numbers of the NAT table prerouting chain in detail.3.3 matching conditionsInbound and Outbound interfaces (-I and-O)Source and Destination addresses (-s and-d)Protocol type (-P)Source and Destination Ports (-- Sport and -- dport)3.3.1 match by Network Interface-I For example:-I eth0Match whether to come in from network interface eth0
-I ppp0Match whether to come in from the network interface ppp0
-O: Network
I. port forwarding:Before describing port forwarding, let's talk about one thing I encountered recently. I am engaged in testing. A manufacturer calls me to test a server software. Based on win2k, the port number is 881. The server is directly connected to the external network, and the client is accessed through the Server ip address. However, they do not have linux-based server software, as they mean, the server must be switched to windows. As a linux enthusiast, I want everyone to understand t
lines are the more important two lines. VPN can be understood in this way, Linux clients use a virtual network device PPP0 (Windows clients can also be understood as a VPN Virtual network card), connected to the server's virtual networking device Ppp0, so that the client joined the server-side ppp0 on the network. Localip is the IP address that can be assigned t
the asterisk indicates that there is no limit.
Pptpd
Vim/etc/pptpd.conf
Modify the following two lines
Localip 192.168.0.1Remoteip 192.168.0.207-217
Two lines are the more important two lines. VPN can be understood in this way, Linux clients use a virtual network device PPP0 (Windows clients can also be understood as a VPN virtual network card), connected to the server's virtual networking device Ppp0
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.